home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr01 / halcn305.zip / GSDMO_ED.PAS < prev    next >
Pascal/Delphi Source File  |  1993-04-21  |  2KB  |  76 lines

  1. program GSDMO_ED;
  2. {------------------------------------------------------------------------------
  3.                                  DBase Editor
  4.  
  5.        Copyright (c)  Richard F. Griffin
  6.  
  7.        14 January 1993
  8.  
  9.        102 Molded Stone Pl
  10.        Warner Robins, GA  31088
  11.  
  12.        -------------------------------------------------------------
  13.        This program demonstrates how to edit a dBase memo file using
  14.        Griffin Solutions units.
  15.  
  16.        If the GSDMO_07.DBF file does not exist, the program will display a
  17.        a message that the file was not found and to run GSDMO_07 to make
  18.        the file.
  19.  
  20. -------------------------------------------------------------------------------}
  21. {$N+,E+}          {Required for floating point number handling}
  22.  
  23. uses
  24.    CRT,
  25.    GSOB_EDT,
  26.    GSOB_DSK,
  27.    GSOBShel;
  28. var
  29.    MyEdit  : GSO_EditView;
  30.    Ch      : char;
  31.  
  32. procedure EditTheMemo;
  33. var
  34.    ov   : string[10];
  35.    ml   : integer;
  36. begin
  37.    ov := FieldGet('COMMENTS');
  38.    MemoGet('COMMENTS');
  39.    ml := MemoLines;
  40.    if ml <> 0 then
  41.    begin
  42.       window(1,2,80,25);
  43.       MyEdit.Init(DBFActive^.MemoFile^.MemoCollect,
  44.                   DBFActive^.MemoFile^.Edit_Lgth);
  45.       if MyEdit.WorkView and MyEdit.Modified then
  46.       begin
  47.          MemoPut('COMMENTS');
  48.          if FieldGet('COMMENTS') <> ov then Replace;
  49.       end;
  50.       window(1,1,80,25);
  51.    end;
  52.    writeln;
  53. end;
  54.  
  55. begin
  56.    ClrScr;
  57.    if not GS_FileExists('GSDMO_07.DBF') then
  58.    begin
  59.       Writeln('File GSDMO_07.DBF is unavailable. Run GSDMO_07.PAS');
  60.       halt;
  61.    end;
  62.    Select(1);
  63.    Use('GSDMO_07');
  64.    MemoWidth(75);     {sets width of the memo line.  Default is 50}
  65.    GoTop;
  66.    while not dEOF do
  67.    begin
  68.       ClrScr;
  69.       writeln(FieldGet('LASTNAME'),', ',
  70.               FieldGet('FIRSTNAME'));
  71.       EditTheMemo;
  72.       Skip(1);
  73.    end;
  74.    CloseDataBases;
  75. end.
  76.